using System;
using IQIGame.Onigao.Framework;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    public class PlayerMoveEndCommand : PlayerCommand
    {
        public override EPlayerCommandType type => EPlayerCommandType.MoveEnd;
        
        public override void Execute(UnitView entity)
        {
            var moveComponent = entity.GetComponent<BattleMoveComponent>(ETComponentType.BattleMoveComponent);

            if (moveComponent != null)
            {
                // moveComponent.Stop();
                moveComponent.SetSpeedAspect(Vector3.zero);
            }
        }
        
        public override void Free()
        {
            ClassPool.Put(this);
        }
    }
}